package com.travel.server.manager.dao;

import com.travel.server.manager.model.CustomerInfo;
import com.travel.server.manager.model.CustomerInfoExample;
import com.travel.server.manager.model.dto.CustomerItemDto;
import com.travel.server.manager.model.dto.data.*;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface CustomerInfoDao {
    int countByExample(CustomerInfoExample example);

    int deleteByExample(CustomerInfoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(CustomerInfo record);

    int insertSelective(CustomerInfo record);

    List<CustomerInfo> selectByExample(CustomerInfoExample example);

    CustomerInfo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") CustomerInfo record, @Param("example") CustomerInfoExample example);

    int updateByExample(@Param("record") CustomerInfo record, @Param("example") CustomerInfoExample example);

    int updateByPrimaryKeySelective(CustomerInfo record);

    int updateByPrimaryKey(CustomerInfo record);

    List<CustomerItemDto> selectByPage(CustomerInfoExample example);

    int batchInsert(List<CustomerInfo> list);

    List<DealCustomerAnalysisDto> selectDealCustomerOrder(@Param("lastTime")Date lastTime, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("group")Integer group);

    List<CustomerDataDto> selectCustomerData(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("memberId")Integer memberId, @Param("highMemberId")Integer highMemberId);

    List<CustomerDataDto> selectCustomerAnalysis(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<MemberDealDto> selectMemberDeal(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("memberId")Integer memberId, @Param("highMemberId")Integer highMemberId);

    List<CustomerRepeatDto> selectCustomerRepeat(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<CustomerAreaDto> selectDistribution();

    List<ProjectCustomerDto> selectProjectCustomer(@Param("offset") Integer offset, @Param("limit") Integer limit);

    Integer selectProjectCustomerCount();
}